package me.kevinwalker.config;

import me.kevinwalker.MongoDBToolProperties;
import me.kevinwalker.core.MongoDBTool;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Configuration
@EnableConfigurationProperties(MongoDBToolProperties.class)
public class MongoDBToolConfig {

    @Resource
    private MongoDBToolProperties mongoDBToolProperties;


    @PostConstruct
    public void fun1() {
        MongoDBTool.setClientInfo(mongoDBToolProperties.getHost(), mongoDBToolProperties.getPort());
    }

}
